package itdep.common.services.impl;

/**
 * @author Ivan Khalopik
 * @version $Revision: 4 $ $Date: 2010-06-10 13:13:16 +0000 (Thu, 10 Jun 2010) $
 */
public abstract class Paginations {
	public static PaginationBuilder all() {
		return PaginationBuilder.create();
	}

	public static PaginationBuilder allSorted(final String property) {
		return PaginationBuilder.create().sort(property);
	}

	public static PaginationBuilder allSorted(final String property, final boolean ascending) {
		return PaginationBuilder.create().sort(property, ascending);
	}

	public static PaginationBuilder simple(final int start, final int count) {
		return PaginationBuilder.create().start(start).count(count);
	}

	public static PaginationBuilder simpleSorted(final int start, final int count, final String property) {
		return PaginationBuilder.create().start(start).count(count).sort(property);
	}

	public static PaginationBuilder simpleSorted(final int start, final int count, final String property, final boolean ascending) {
		return PaginationBuilder.create().start(start).count(count).sort(property, ascending);
	}

	public static PaginationBuilder fromTo(final int from, final int to) {
		return PaginationBuilder.create().start(from).end(to);
	}

	public static PaginationBuilder fromToSorted(final int from, final int to, final String property) {
		return PaginationBuilder.create().start(from).end(to).sort(property);
	}

	public static PaginationBuilder fromToSorted(final int from, final int to, final String property, final boolean ascending) {
		return PaginationBuilder.create().start(from).end(to).sort(property, ascending);
	}
}